<html>
<head>
<title>ASP.NET Validation Controls</title>
<script language="javascript" 
        src="/js/WebUIValidation.js">
</script>
<!-- #include file="style.inc" -->
</head>
<body bgcolor="#ffffff">
<!--------------------------------------------------------------------------->
<span class="heading">Sumit Form</span> &nbsp; &nbsp; &nbsp;
<form runat="server" action="getvalue.aspx" method="post">
 <table border="0">
<tr>
  <td valign="top">Email</td>
  <td><input type="text" id="email" 
	maxlength="50" size="50" runat="server" />
	<asp:RequiredFieldValidator 
	id="valRequired" runat="server"
          	 ControlToValidate="email"
          	 ErrorMessage="Email can not empty, 
		please enter your email."
          	 Display="dynamic">*         	 
      </asp:RequiredFieldValidator><br />	      
  </td>
 </tr>
<tr>
  <td valign="top">Fullname</td>
  <td><input type="text" id="fullname" 
	maxlength="50" size="50" runat="server" />
	<asp:RequiredFieldValidator 
	id="valCompare" runat="server"
          	 ControlToValidate="fullname"
          	 ErrorMessage="Fullname can not empty, 
		please enter your fullname."
          	 Display="dynamic">*
      </asp:RequiredFieldValidator><br />	      
  </td>
 </tr>
 </table>
<asp:ValidationSummary id="valSummary" runat="server"
     HeaderText="<b>The following errors were found:</b>"
     ShowSummary="True" 
     ShowMessageBox ="False"
     DisplayMode="List"/>

<hr />
<input type="submit" id="cmdConfirm" value="Submit" runat="server" onserverclick="ConfirmEntry">&nbsp; &nbsp;
<input type="reset" value="Cancel" runat="server" >&nbsp; &nbsp;
</form>
<script language="VB" runat="server">
Sub Page_Load()
  Dim objValidator As BaseValidator
  For Each objValidator In Page.Validators
    objValidator.Enabled = True
    objValidator.EnableClientScript=False
  Next
End Sub
Sub ConfirmEntry(objSender As Object, objArgs As EventArgs)
  'Response.write("Status" + valRequired.IsValid.ToString())
  if Page.IsValid then
	response.redirect("getvalue.aspx?email=" + _
	request.form("email")+"&fullname="+ _
	request.form("fullname"))
  end if
End Sub
</script>
<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>

